home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Libraries / PlayerPRO 4.4.1 / Filters Plugs / PPPlug.h < prev    next >
Text File  |  1995-04-16  |  4KB  |  116 lines

  1. /********************                        ***********************/
  2. //
  3. //    Player PRO 4.4x -- Plug FILTERS Definition
  4. //
  5. //    Version 2.0
  6. //
  7. //    To use with PlayerPRO & CodeWarrior ( current vers 5.5)
  8. //
  9. //    Antoine ROSSET
  10. //    16 Tranchees
  11. //    1206 GENEVA
  12. //    SWITZERLAND
  13. //    
  14. //    FAX:            (+41 22) 346 11 97
  15. //    Compuserve:        100277,164
  16. //    Internet:         rosset@dial.eunet.ch
  17. //
  18. //    *****************                        ***********************/
  19. //
  20. //    Your main function have to be in this form:
  21. //    OSErr main(     Ptr                        *InstrumentPtr,                // the Instrument IN Ptr
  22. //                    struct FileInstrData    *theData,                    // Instrument informations, see MAD.h
  23. //                    long                    SelectionStart,                // SelectionStart 
  24. //                    long                    SelectionEnd,                // SelectionEnd, your filter SHOULD apply his effect only on the selection
  25. //                    PPInfoPlug                *thePPInfoPlug)                // Some functions of PlayerPRO that you can use in your plugs
  26. //
  27. //
  28. //    *****************                        ***********************/
  29. //
  30. //    If you want to reallocate InstrumentPtr:
  31. //    
  32. //    if( *InstrumentPtr != 0L) DisposPtr( *InstrumentPtr);    // VERY IMPORTANT
  33. //    *InstrumentPtr = NewPtr( newsize);                        // Use NewPtr ONLY to allocate memory!
  34. //    
  35. //    theData->insSize = newsize;                                // In bytes !! Even for 16 bits !
  36. //    
  37. //    Don't forget to UPDATE the theData->insSize !!!!!!!!!!!!
  38. //
  39. //    *****************                        ***********************/
  40. //
  41. //    About Resources:
  42. //
  43. //    Your Plug should have: Creator: 'SNPL', Type: 'PLug'
  44. //
  45. //    Your Plug have to have these resources:
  46. //
  47. //    - One segment CODE 1000 with 68k Code  ** You should NOT use the 68881 coprocessor **
  48. //    - One segment PPCC 1000 with PPC Code  (OPTIONAL: if PlayerPRO in PPC cannot find it, it will use the CODE 1000 resource)
  49. //    - One STR# resource :
  50. //
  51. //        1 string: Menu Name (see Instrument window in PlayerPRO)
  52. //
  53. /********************                        ***********************/
  54.  
  55. typedef struct
  56. {
  57.     void        *RPlaySoundUPP;            //    OSErr            RPlaySound( Ptr whichSound, long SoundSize, long whichTrack, long Period, long Amplitude, long loopStart, long loopLength)
  58.     void        *UpdateALLWindowUPP;    //    void            UpdateALLWindow( void)
  59.     void        *MyDlgFilterUPP;        //    pascal Boolean    MyDlgFilter( DialogPtr theDlg, EventRecord *theEvt, short *itemHit)
  60.     
  61. } PPInfoPlug;
  62.  
  63. typedef OSErr            (*RPlaySoundUPP)        ( Ptr, long, long, long, long, long, long);
  64. typedef void            (*UpdateALLWindowUPP)    ( void);
  65. typedef pascal Boolean    (*MyDlgFilterUPP)        ( DialogPtr, EventRecord*, short*);
  66.  
  67.  
  68. #if defined(powerc) || defined(__powerc)
  69.  
  70.         /****** POWERPC calls *********/
  71.  
  72. #define         RPlaySoundCallMode (    kCStackBased|\
  73.                 RESULT_SIZE( SIZE_CODE( sizeof(OSErr) ))|\
  74.                 STACK_ROUTINE_PARAMETER( 1, SIZE_CODE( sizeof( Ptr)))|\
  75.                 STACK_ROUTINE_PARAMETER( 2, SIZE_CODE( sizeof( long)))|\
  76.                 STACK_ROUTINE_PARAMETER( 3, SIZE_CODE( sizeof( long)))|\
  77.                 STACK_ROUTINE_PARAMETER( 4, SIZE_CODE( sizeof( long)))|\
  78.                 STACK_ROUTINE_PARAMETER( 5, SIZE_CODE( sizeof( long)))|\
  79.                 STACK_ROUTINE_PARAMETER( 6, SIZE_CODE( sizeof( long)))|\
  80.                  STACK_ROUTINE_PARAMETER( 7, SIZE_CODE( sizeof( long))))
  81.  
  82. #define CallRPlaySoundUPP( v1, v2, v3, v4, v5, v6, v7)        \
  83.         CallUniversalProc( thePPInfoPlug->RPlaySoundUPP, RPlaySoundCallMode, v1, v2, v3, v4, v5, v6, v7)
  84.  
  85. /**/
  86.  
  87. #define            UpdateALLWindowCallMode (    kCStackBased)
  88.  
  89. #define CallUpdateALLWindowUPP()        \
  90.         CallUniversalProc( thePPInfoPlug->UpdateALLWindowUPP, UpdateALLWindowCallMode)
  91.  
  92. /**/
  93.  
  94. #else    /******** 68K calls ***********/
  95.  
  96. #define CallRPlaySoundUPP( v1, v2, v3, v4, v5, v6, v7)        \
  97.         (* (RPlaySoundUPP) (thePPInfoPlug->RPlaySoundUPP))( v1, v2, v3, v4, v5, v6, v7)
  98.  
  99. /**/
  100.  
  101. #define CallUpdateALLWindowUPP()        \
  102.         (* (UpdateALLWindowUPP) (thePPInfoPlug->UpdateALLWindowUPP))
  103.  
  104. /**/
  105. #endif
  106.  
  107. /********************                        ***********************/
  108. //
  109. //
  110. // RPlaySoundUPP    : See Developper Toolkit documentation. Play a SoundPtr at a specific Period by using PlayerPRO Driver.
  111. // UpdateALLWindow    : Check all PlayerPRO windows and update them if need it.
  112. // MyDlgFilterUPP    : to use with a ModalDialog function: allow movable dialog, PlayerPRO windows updating, Item 1 Frame, Copy/Paste support, Key support
  113. //
  114. //
  115. /********************                        ***********************/
  116.